// uno.config.ts
import {
  defineConfig,
  presetAttributify,
  presetIcons,
  presetTypography,
  presetUno,
  presetWebFonts,
  transformerDirectives,
  transformerVariantGroup,
} from 'unocss'

export default defineConfig({
  presets: [presetUno(), presetAttributify(), presetIcons(), presetTypography(), presetWebFonts()],
  transformers: [transformerDirectives(), transformerVariantGroup()],
  rules: [
    [
      /^(h|w)-calc-([+\-*\/])(\d+)([a-z%]*)$/,
      ([_, type, op, val, unit]) => ({
        [type === 'h' ? 'height' : 'width']: `calc(100% ${op} ${val}${unit})`,
      }),
    ],
  ],
})
